<div class="box">

     <?php 
     if($this->session->flashdata("sms_success")){
          echo '
          <div class="alert alert-success" role="alert">
               <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
               </button>'.$this->session->flashdata("sms_success").'</div>';
          }

          ?>
     <div class="col-md-12 bs-wizard">
          <div class="col-xs-4 bs-wizard-step <?php echo ($this->session->userdata('registerInfor'))?'disabled':'complete' ?>">
               <div class="text-center bs-wizard-stepnum">expédition</div> <!-- Review Your Order -->
               <div class="progress"><div class="progress-bar"></div></div>
               <a href="#review" data-toggle="tab" class="bs-wizard-dot"></a>
          </div>

            <div class="col-xs-4 bs-wizard-step <?php echo ($this->session->userdata('registerInfor'))?'complete':'disabled' ?> ">
              <div class="text-center bs-wizard-stepnum">état de vos reponses</div>
              <div class="progress"><div class="progress-bar"></div></div>
              <a href="#payment" data-toggle="tab" class="bs-wizard-dot"></a>
            
          </div>
          <div class="col-xs-4 bs-wizard-step disabled"><!-- active -->
               <div class="text-center bs-wizard-stepnum">fait</div> <!-- Done -->
               <div class="progress"><div class="progress-bar"></div></div>
               <a href="#done" data-toggle="tab" class="bs-wizard-dot"></a>
          </div>
    </div>

    <div class="tab-content">

        <div id="review" class="tab-pane fade <?php echo ($this->session->userdata('registerInfor'))?' ':'in active' ?> ">
                    <?php if(!$this->cart->contents()):
                    echo "<p class='text-center'>No item</p>";
                    else:
                         if($result_user->num_rows() <= 0 ):
                              ?>

                         <?php echo form_open("book/addOrderInfo",'class="form-horizontal" id="idOrderInfo"'); ?>
                         <div  class="col-lg-9 col-lg-offset-1">
                              <p><span class="textRed">* </span> Pour s’assurer que vos produits arrivent, entrez le bon code postal.</p>  <!-- <p><span class="textRed">* </span> To ensure you get your products on time, please provide the correct post code.</p> -->
                              <br/>
                              <h5><b>1. Entrez les informations pour la livraison:</b></h5> <!-- <h5><b>1. Please fill in your shipping information:</b></h5> -->
                              <hr/>
                              <div class="form-group">
                                   <p class="textRed"><?php echo $error_zip; ?></p>
                              </div>

                              <div class="form-group">
                                   <label class="col-sm-3">Nom et prénom</label> <!-- <label class="col-sm-3">Contact Name</label> -->
                                   <div class="col-sm-9">
                                        <input type="text" name="contactName" value="<?php echo set_value('contactName'); ?>" class="form-control field no_radus" placeholder="Please enter the contact" />                                
                                   </div>
                              </div>
                              <div class="form-group">
                                   <label class="col-sm-3">Pays</label> <!-- <label class="col-sm-3">Country/Region</label> -->
                                   <div class="col-sm-9">

                                        <?php

                                        $countryArr = array(NULL=>"-- Please Select Country --");
                                        foreach (getCountry()->result() as $key => $coun) {
                                             $countryArr[$coun->countryid] = $coun->country_name;
                                        }
                                        echo form_dropdown("country",$countryArr,set_value('country'),'class="form-control no_radus field"');
                                        ?>

                                   </div>                             
                              </div>
                              <div class="form-group">
                                   <label class="col-sm-3">Adresse</label> <!-- <label class="col-sm-3">Street Address</label> -->
                                   <div class="col-sm-9">
                                        <input type="text" name="street" value="<?php echo set_value('street'); ?>" class="form-control field no_radus" placeholder="Street address" /> 

                                   </div>
                              </div>
                              <div class="form-group">
                                   <label class="col-sm-3"></label>
                                   <div class="col-sm-9">
                                        <input type="text" name="apartment" class="form-control field no_radus" placeholder="Apartment, suite, unit etc. (optional)" />
                                   </div>
                              </div>

                              <div class="form-group">
                                   <label class="col-sm-3">Ville</label> <!-- <label class="col-sm-3">City</label> -->
                                   <div class="col-sm-9">
                                        <input type="text" name="city" value="<?php echo set_value('city'); ?>" class="form-control field no_radus" placeholder="Please enter the city"/>
                                   </div>                             
                              </div>

                              <div class="form-group">
                                   <label class="col-sm-3"></label>
                                   <div class="col-sm-9">
                                        <input type="text" name="province" value="<?php echo set_value('province'); ?>" class="form-control field no_radus" placeholder="State/Province/Region"/>
                                   </div>                             

                              </div>
                              <div class="form-group">
                                   <label class="col-sm-3" >Post Office</label>  <!-- City -->
                                   <div class="col-sm-9">
                                  <?php

                                   $postOfficeArr= array(""=>"-- Please Select Post Office --");
                                   foreach (getShippingPrice()->result() as $key => $postOffice) {
                                        $postOfficeArr[$postOffice->shippingID] = $postOffice->shipping_place;
                                   }
                                   echo form_dropdown("postOfficeId",$postOfficeArr,set_value('postOfficeId'),'class="form-control field no_radus"');
                                   ?>
                                   </div>

                              </div>

                              <div class="form-group">
                                   <label class="col-sm-3">Code postal</label> <!-- <label class="col-sm-3">Zip/Postal Code</label> -->
                                   <div class="col-sm-9">
                                        <input type="text" name="sipCode" value="<?php echo set_value('sipCode'); ?>" class="form-control field no_radus" />
                                        <span class="textRed"><?php echo $error_zip; ?></span>
                                       
                                   </div>                             
                              </div>
                              <div class="form-group">                          
                                   <label class="col-sm-3">Teléphone portable</label> <!-- <label class="col-sm-3">Mobile</label> -->
                                   <div class="col-sm-9">
                                        <input type="text" name="mobile" value="<?php echo set_value('mobile'); ?>" class="form-control field no_radus"/>
                                   </div>                   
                              </div>
                              <div class="form-group">
                                   <div class="col-sm-3"></div>
                                   <div class="col-sm-9">
                                        <?php 

                                        echo form_submit('save', 'Achetez avec cette adresse de livraison','class="btn btn-primary no_radus"'); 


                                        ?>
                                   </div>

                              </div>

                         </div>

                         <?php 
                         echo form_close();
                         else:

                              ?>

                         <div  class="col-lg-10 col-lg-offset-1">
                              <h5><b>1. Entrez les informations pour la livraison:</b></h5> <!-- <h5><b>1. Please fill in your shipping information:</b></h5> -->
                              <hr/>

                              <div class="col-lg-5 ">
                                   
                                   <?php foreach(getShippingDetailUs($this->session->userdata('userId'))->result() as $valueAddess){
                                             echo form_open("book/OrderExitUser"); 
                                             echo '<div class="form-group" id="idShipping_'.$valueAddess->user_shipping_id.'">';
                                             echo '<p><b> '.$valueAddess->fullname.'</b><br/>';
                                             echo      $valueAddess->street.'<br/>';
                                             echo $valueAddess->city.', '.$valueAddess->state.', '.$valueAddess->zipCode;
                                             echo '<br/> Pays : '.$valueAddess->country_name;
                                             echo '<br/> Poste : '.$valueAddess->shipping_place;
                                             echo '<br/> Mobile  : '.$valueAddess->mobile;
                                             echo '</p>';
                                             echo '<p>';
                                             echo form_submit("","Achetez avec cette adresse de livraison",'class="btn btn-primary no_radus"');
                                             echo '</p><p>';
                                             echo anchor("book/getDetailShipping/".$valueAddess->user_shipping_id,'<span class="label label-default no_radus btn_label_primary">Conserver</span>','class="editShipping"').'&nbsp;&nbsp;';
                                             echo anchor("book/deleteDetailShipping/".$valueAddess->user_shipping_id,'<span class="label label-default no_radus btn_label_primary">Supprimer</span>' );
                                             echo form_hidden("userOrderId",$valueAddess->user_shipping_id);
                                             echo '</p>';
                                             echo '</div>';
                                             echo '</form>';
                                   } ?>
                                   
                                   
                              </div>
                              <div class="col-lg-7">

                                   <form action="<?php echo base_url(); ?>index.php/book/addOrderInfo" class="form-horizontal formShippingAddess" method="post">
                                        <div class="form-group">
                                             <p class="textRed"><?php echo $error_zip; ?></p>
                                        </div>
                                        <div class="form-group">
                                             <p><b>Ajoutez une nouvelle adresse</b></p>
                                        </div>
                                        <div class="form-group">


                                             <label>Nom et prénom</label> <!-- ContactName -->


                                             <input type="text" name="contactName"  value="<?php echo set_value('contactName'); ?>" class="form-control contactName no_radus" placeholder="Entrez l'information" />                                   
                                             <span class="textRed"><?php echo form_error('contactName'); ?></span>
                                        </div>
                                        <div class="form-group">
                                             <label >Pays</label> <!-- Country/Region -->


                                             <?php

                                             $countryArr= array(NULL=>"-- Choisssez le pays --");
                                             foreach (getCountry()->result() as $key => $coun) {
                                                  $countryArr[$coun->countryid] = $coun->country_name;
                                             }
                                             echo form_dropdown("country",$countryArr,set_value('country'),'class="form-control countryId no_radus"');
                                             ?>
                                             <span class="textRed"><?php echo form_error('country'); ?></span>

                                        </div>
                                        <div class="form-group">
                                             <label >Adresse</label> <!-- Street Address -->

                                             <input type="text" name="street" value="<?php echo set_value('street'); ?>" class="form-control streetAddess  no_radus" placeholder="Nom de la rue" /> 
                                             <span class="textRed"><?php echo form_error('street'); ?></span>

                                        </div>
                                        <div class="form-group">


                                             <input type="text" name="apartment" class="form-control apartmentName no_radus" placeholder="residence, cite, etc." />

                                        </div>

                                        <div class="form-group">
                                             <label >Ville</label>  <!-- City -->

                                             <input type="text" name="city" value="<?php echo set_value('city'); ?>" class="form-control cityName no_radus" placeholder="Nom de la ville"/>
                                             <span class="textRed"><?php echo form_error('city'); ?></span>
                                        </div>

                                        <div class="form-group">
                                             <label></label>
                                             <input type="text" name="province" value="<?php echo set_value('province'); ?>" class="form-control provinceName  no_radus" placeholder="Pays"/>
                                             <span class="textRed"><?php echo form_error('province'); ?></span>

                                        </div>

                                        <div class="form-group">
                                             <label >Poste</label>  <!-- Post Office -->

                                            <?php

                                             $postOfficeArr= array(""=>"-- Choisir votre Poste --");
                                             foreach (getShippingPrice()->result() as $key => $postOffice) {
                                                  $postOfficeArr[$postOffice->shippingID] = $postOffice->shipping_place;
                                             }
                                             echo form_dropdown("postOfficeId",$postOfficeArr,set_value("postOfficeId"),'class="form-control countryId no_radus"');
                                             ?>
                                             <span class="textRed"><?php echo form_error('postOfficeId'); ?></span>

                                        </div>
                                        <div class="form-group">
                                             <label>Code postal</label>  <!-- Zip/Postal Code -->

                                             <input type="text" name="sipCode" value="<?php echo set_value('sipCode'); ?>" class="form-control shipcode no_radus" />
                                             <span class="textRed"><?php echo form_error('sipCode'); ?></span>
                                             <span class="textRed"><?php echo $error_zip; ?></span>


                                        </div>
                                        <div class="form-group">                          
                                             <label >Teléphone portable</label>  <!-- Mobile -->

                                             <input type="text" name="mobile" value="<?php echo set_value('mobile'); ?>" class="form-control mobileNum  no_radus"/>
                                             <span class="textRed"><?php echo form_error('mobile'); ?></span>
                                        </div>
                                        <div class="form-group">
                                             <input type="submit" class="btn btn-primary saveBtnShipping  no_radus" value="Achetez avec cette adresse de livraison" />
                                            
                                             <input type="hidden" name="shippingId" class="shippingId"> 
                                        </div>

                                   </form>

                              </div>
                         <div class="row">
                         </div>

                         </div>

               <?php 
                         endif;

                    endif;
               ?>

               </div>     
               <div id="done" class="tab-pane fade">
                    <div  class="col-lg-8 col-lg-offset-1">
                         <h4 class="">1.Payment Page</h4>
                         <form>
                              <div class="form-group">

                              </div>

                         </form>
                    </div>
               </div>
              
          </div>

      </div>